- /* sdcm2pi.cpp by K.Tsuru */
- // function ID 3506 DRADIX, constant
- /********************************
- SDouble class
- 2/pi
- Used in the reduction of an argument
- of trigonometric functions.
- *********************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- static SDouble* m2pi = NULL; //keep in the static memory
- static uint m2pi_size = 0;
-
- void M2PiFree(){ //free memory of m2pi
- if(m2pi_size == 0) return;
- delete m2pi; m2pi = NULL; m2pi_size = 0;
- }
-
- /* 2/pi */
- SDouble M2Pi(){
- uint ms = SNManager::SNMaxSize(SNManager::REAL);
- if(m2pi_size < ms){
- if(m2pi == NULL) m2pi = new SDouble;
-
- SDouble pi2 = MPi2(); // pi/2
- *m2pi = DReciprocal(pi2); // 2/pi
- m2pi_size = ms;
- }
- return *m2pi;
- }
sdcm2pi.cpp : last modifiled at 2017/06/23 10:17:11(738 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).